import request from '@/utils/request'
//分页获取门户
export function getPagePortal(params) {
    return request({
        url: '/sys/portal/pageRelease',
        method: 'get',
        params: params
    })
}

//获取门户详细信息
export function getPortalInfo(params) {
    return request({
        url: '/sys/portal/get',
        method: 'get',
        params: params
    })
}

//新增门户
export function addPortal(params) {
    return request({
        url: '/sys/portal/create',
        method: 'post',
        data: params
    })
}

//删除门户
export function delPortal(params) {
    return request({
        url: '/sys/portal/delete',
        method: 'delete',
        params: params
    })
}

//编辑门户
export function editPortal(params) {
    return request({
        url: '/sys/portal/update',
        method: 'put',
        data: params
    })
}

//获取数据库表
export function getAllTable() {
    return request({
        url: '/sys/portal/getTableNameList',
        method: 'get'
    })
}

//获取字段名
export function getAllField(params) {
    return request({
        url: '/sys/portal/getFieldNameList',
        method: 'get',
        params: params
    })
}

// 获取数据源库表数据
export function listchoose() {
  return request({
    url: '/infra/source/listchoose',
    method: 'get',
  })
}

// 根据库表id获取数据库字段数据
export function sourceTestList(params) {
  return request({
    url: '/infra/rdb/execute/sourceTestList',
    method: 'get',
    params:params
  })
}

//获取字段计算值(数字类型)
export function getComputeField(params) {
    return request({
        url: '/sys/portal/getFunData',
        method: 'get',
        params: params
    })
}

//获取图表组件X/Y/名称/显示计算值
export function getChartData(params) {
    return request({
        url: '/sys/portal/getChartData',
        method: 'get',
        params: params
    })
}

//获取我的任务
export function getMyTask() {
    return request({
        url: '/bpm/task/bpm-task-statis',
        method: 'get'
    })
}

//获取X轴/Y轴数据
export function getFieldData(params) {
    return request({
        url: '/sys/portal/getFieldData',
        method: 'get',
        params: params
    })
}

//获取我的任务
export function getTodoTask(params) {
    return request({
        url: '/bpm/task/todo-page',
        method: 'get',
        params: params
    })
}

export function batchDelPortal(params) {
    return request({
        url: '/sys/portal/batchDelete',
        method: 'delete',
        data: params
    })
}

//根据appId获取
export function getAppIdData(params) {
    return request({
        url: '/sys/portal/getMoveOne',
        method: 'get',
        params: params
    })
}
//获取字段计算值(非数字类型)
export function getComputeFieldNew(params) {
    return request({
        url: '/form/project/getDataSunRemoval',
        method: 'get',
        params: params
    })
}
//计算方式
export function getColumnFormula(params) {
    return request({
        url: '/form/project/getGatewayColumnFormula',
        method: 'post',
        data: params
    })
}